1. Field of the Invention
The present invention relates to a method for error checking when playing an MP3 (Moving Pictures Experts Group Layer III Audio) file. More specifically, a method of playing the MP3 file while providing error check protection when recognizable error check fields exist in an MP3 bitstream, and playing the MP3 bitstream without error checking when recognizable error check fields do not exist in the MP3 bitstream is disclosed.
2. Description of the Prior Art
MPEG-1 audio layer III (MP3) is an ISO/IEC (International Organization for Standardization and International Electrotechnical Commission) standard of audio coding with high quality and high efficiency.
Referring to FIG. 1, an MP3 file comprises a series of frames and each frame comprises several fields such as a header 1, an error check 2, an audio—data 3, and an external—data 4. The header 1 of each frame is further divided into groups of bits relating to the file type, sampling rate, and other frame specific information. A protection bit, bit number 16 of the 32 bit header 1, discloses whether error protection is used in the frame. If the bit number 16 is a value of zero, error protection is used and the header 1 is followed by a 16 bit error check 2. The error check in the error check field 2 uses CRC protection mechanism. When CRC error protection is used in the MP3 file, the initial state of a shift register is ‘1111 1111 1111 1111’ and the CRC generator polynomial is g(x)=x16+x15+x2+1. If the bit number 16 is a value of 1, no error protection is used and there is no error check 2 following the frame header. The audio—data 3 contains the encoded audio samples. The external—data 4 contains other information, such as title, of the encoded audio samples.
While using the error check 2 is not necessary to encode and decode an MP3 file, as with any error trapping routine, error checking can improve performance by correcting or eliminating faulty frames before playing. The error check 2 can be used to determine if the data within the audio—data 3 has been written and read correctly and is quite useful for providing accurate reproduction of sound played from the MP3 file, but is most valuable only if used in a consistent manner. Different encoders can generate different error check fields although the input source is the same. Some encoders may possibly use a wrong generator polynomial, a wrong initial state, or simply calculate incorrectly, all resulting in a wrong error check value. Because of this, the error check field 2 encoded by one encoder is not always acceptable to a different decoder. Additionally, some encoders simply skip using error checking and mark the protection bit of the header with a 1 meaning that no error check field 2 exists within the frame.
Different MP3 decoders deal with this problem with different approaches. One of the most common strategies used is simply not to play MP3 frames with wrong error check fields. This policy does eliminate the noise resulting from individual corrupted frames. However, this same policy makes it impossible to play a file generated by an incompatible encoder or a file simply lacking fields even though all of the other data in the file is complete and correct. Therefore, this approach limits the files that can be played by the decoder to only those MP3 files perfectly compatible with the right CRC field.
Another well-known approach to the incompatibility problem is to go to the other extreme and never use error check protection regardless whether the protection is or is not available. While this strategy allows the playing of all MP3 files regardless of the encoders, the strategy fails to eliminate noise resulting from corrupted frames within a compatible bitstream.